package com.example.aiscripteditorserver.controller;


import com.example.aiscripteditorserver.common.tools.excel.ExcelReader;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

@Slf4j
@RestController
@RequestMapping("/excel")
public class ExcelController {
    
    @GetMapping("read_col12")
    public Map<String, Double> read_col12() {

        Map<String, Double> res = null;
        try {
            File file = new File("F:\\项目相关信息\\25.触控精灵\\价格表.xlsx");
            res = ExcelReader.readCol1Col2(file);

            log.info("excel文件内容：\n" + res.toString());
        }catch (Exception e) {
            log.error("读取Excel文件失败", e);
        }
        
        return res;
        
    }
    
    


}
